#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#ifdef _WIN32
#include <GL/glut.h>
#endif
#endif

/* ------------------------------------------------------------------------*/
// macro definitions
#define ESC 27

/* ------------------------------------------------------------------------*/
// struct definition
typedef struct {
	real x,y,z;                         // 3D coordinates
} recVec;


typedef struct {
	recVec viewPos;                     // view position
	recVec viewDir;                     // view direction vector
	recVec viewUp;                      // view up direction
	recVec rotPoint;                    // Ppoint to rotate about
	GLdouble aperture;                  // pContextInfo->camera aperture
	GLint viewWidth, viewHeight;        // current window/screen size
} recCamera;


/* ------------------------------------------------------------------------*/
// global variables to declare and initialization

// display list
extern GLuint ball_list;
extern GLuint axes_list;


/* ------------------------------------------------------------------------*/
// functions about display
void GL_Main_Display(void);
void GL_Main_Resize(int width, int height);
//void GL_Sub_Display(void);
//void GL_Sub_Resize(int width, int height);
void GL_DrawBall(void);
void GL_DrawBox(void);
void GL_Draw2D(void);
void GL_Draw3D(void);
/* ------------------------------------------------------------------------*/
// functions about control: Keyboard, Mouse, Camera, ...
void GL_SetCam(recCamera *cam);
void GL_Motion(int x, int y);
void GL_Mouse(int button, int state, int x, int y);
void GL_Keyboard(unsigned char key, int x, int y);
void GL_Sub_Keyboard(unsigned char key, int x, int y);
/* ------------------------------------------------------------------------*/
// program procedure functions
void GL_Generate_CallLists();
int opengl_display(int argc, char ** argv);
int create_mainWindow(int pos_x, int pos_y, int w, int h);
int create_subWindow(int pos_x, int pos_y, int w, int h, int TYPE);
void PG_Bail(int code);
void PG_OneStep(void);
void GL_Idle(void);
//void PG_Cluster(psParticle* p);
//void PG_TimeStep(psParticle* p, float dt);



